#!/bin/sh

echo -n "Host to ping?:"
read HOST
echo -n "Delay between pings(seconds):"
read WAIT

while true
do
  NOW=$(date)
  PING=$(ping $HOST -c10 | egrep 'packet|rtt')
  curl http://localhost/toDB.php --data "data=$PING" --data "date=$NOW" --data "host=$HOST"
  sleep $WAIT
done
